package Day017_缓冲流_转换流_序列化流_打印流.ZuoYe;

import java.io.*;

/**
 * @author zhangyan
 * @date 2020/5/9 19:35
 */
public class Test5 {
    public static void main(String[] args) throws Exception{

        //创建高效字符输入流对象,关联数据源文件路径
        BufferedReader br = new BufferedReader(new FileReader("Demo02\\aaa\\text.txt"));
        //读取每行数据
        String line1 = br.readLine();
        String line2 = br.readLine();
        //关流
        br.close();

        //创建高效字符输出流,关联目的地文件路径
        BufferedWriter bw = new BufferedWriter(new FileWriter("Demo02\\aaa\\text1.txt"));

        //写数据
        bw.write(line2);
        bw.newLine();
        bw.write(line1);

        //关流
        bw.close();
    }
}
